package org.edu.modules.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.mapping.StatementType;
import org.edu.modules.system.entity.ProcessInstance;
import org.edu.modules.system.entity.ProcessType;

import java.util.List;
import java.util.Map;

/**
 * @Author lbh
 * @Date 2025/2/13 上午9:48
 * @Version 1.0
 */
public interface IProcessInstanceService extends IService<ProcessInstance> {
    /**审批*/
    void approveProcess(Integer instanceId,
                        String name,
                        String approvalResult,
                        String comment);

    /**审批不通过重新提交*/
    void resubmitProcess(Integer instanceId,
                         String applicantId,
                         String formData);

    /**发起流程*/
    void createProcess(Integer processTypeId,
                         String applicantId,
                         String formData);

    /**查看流程实例*/
    Map getProcessInstance(Integer instanceId);

    /**待办数量*/
    Integer countDblc(String userId);
    /**已办数量*/
    Integer countYblc(String userId);
    /**我发起的数量*/
    Long countMyCreate(String paramJson,String userId);

    /**查看审批流程列表*/
    IPage<ProcessInstance> getMyApprovals(Page page ,String paramJson,String userId);
    /**查看待办列表*/
    IPage<ProcessInstance> spGetDblcPage(Page page,String userId);
    /**查看已办列表*/
    IPage<ProcessInstance> spGetYblcPage(Page page, String userId);

    /**查看我发起的流程列表*/
    IPage<ProcessInstance> getMyCreateProcess(Page page ,String paramJson,String userId);

    List<Map> countGroupByTypeId();
}
